package com.lzh.designpatterns.dongtaidaili;

/**
 * @author liuzhihao
 * @create 2022-06-15 0:05
 * <p>
 * 中介
 */
public class Proxy implements Rent {

    private Host host;

    public Proxy() {
    }

    public Proxy(Host host) {
        this.host = host;
    }

    @Override
    public void rent() {
        seeHouse();
        host.rent();
        hetong();
        fare();
    }

    private void seeHouse() {
        System.out.println("看房子");
    }

    private void hetong() {
        System.out.println("签合同");
    }

    private void fare() {
        System.out.println("收中介费");
    }
}
